package cn.nange.eurekaclientfeign.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @FeignClient(value = "client-1") 声明当前接口是feign客户端 有发送http请求的能力
 *
 * value 要请求的服务的名字
 */
@FeignClient(value = "client-1",fallback = TestFeignImpl.class)
public interface TestFeign {
    /**
     * 声明要请求服务的哪个接口
     *
     * 当前方法的返回值类型和形参必须和被请求的接口一致  方法名不要求
     * @param name
     * @return
     */

    @RequestMapping("helloClint1")
    String testGet(@RequestParam("name") String name);

    @RequestMapping(path = "testPost",method = RequestMethod.POST)
    String testPost(Map map);
}
